// prettier-ignore
const hours = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
// prettier-ignore
let days = []
for (let i = 0; i <= 25; i++) {
  days.push(i);
}

let option = {
  title: {
    show: true,
    text: '11',
    left: 'center'
  },
  tooltip: {
    position: "top",
    formatter: (params) => {
      let str = params.value[2].toString() + '小时前在线'

      return str
    }
    // formatter: '{c}'
  },
  grid: {
    // height: "50%",
    // top: "10%",
  },
  xAxis: {
    type: "category",
    data: hours,
    splitArea: {
      show: true,
    },
  },
  yAxis: {
    type: "category",
    data: days,
    splitArea: {
      show: true,
    },
    inverse: true,
  },
  visualMap: {
    min: 0,
    max: 8760,
    orient: "horizontal",
    // left: "center",
    right: 0,
    top: 0,
    inRange: {
      // color: ["#f46d43", "#ffffbf", "#ffffff"],
      // color: ['#f76707', '#c5f6fa', '#c3fae8', 'white']

      color:[
        '#a50026',
        '#d73027',
        '#f46d43',
        '#fdae61',
        '#fee090',
        '#ffffbf',
        '#e0f3f8',
        '#abd9e9',
        '#74add1',
        '#4575b4',
        '#313695',
        "#ffffff"
      ]
    },
  },
  series: [
    {
      name: "Punch Card",
      type: "heatmap",
      data: null,


      label: {
        show: true,
        formatter: (params) => { return params.value[params.encode.y[0]].toString() + params.value[params.encode.x[0]].toString() }
      },
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowColor: "rgba(0, 0, 0, 0.5)",
        },
      },
    },
  ],
};

module.exports = { option }